WaterCAD 2024 Help

Edit Queries Dialog (Active Topology)

The Edit Queries Dialog is where you define Active Topology Queries (to be used for determining the active/inactive status of elements in the system).

Navigation: Click the Edit Queries button on the Edit Active Topologies Mode Dialog to access this dialog.

Template Year Installed / Year Retired Query

A common way to configure active topology queries is to utilize the built-in Year Installed / Year Retired fields. Here is the template of that query you can use:

Physical_InstallationYear <= 2000 AND (Physical_RetirementYear > 2000 OR Physical_RetirementYear = 0)
Note: Be sure to edit the year shown in this query (2000 in this example) and provide the year you would like your scenario to represent.
Note: The built-in Year Installed / Year Retired fields are not included on every element type. They are available for Pipes and Customer meters (these are the only ones you’ll need if using the Automatically include connected elements option described below). If you have a need to use similar fields on another element type that does not have them, you can create your own using User Defined Extensions.

Automatically include connected elements

  • When this option is On, you only need to define queries for Pipes and (optionally) Customer Meter elements. The active/inactive status of connected/associated elements will be determined automatically (e.g., start/stop nodes, isolation valves, taps, laterals, customer meters, SCADA elements, etc).

    The Customer Meter query is optional. You only need to define this query if you would like to control the inactive status independently of the associated pipe. For instance, if the associated pipe is active and some Customer Meters associated with that pipe should be inactive (e.g. if some Customer Meters were installed later than the pipe and represent a future system configuration that you want to exclude for the current simulation).

    Note: On extremely large systems, the automatic handling of connected elements can be time-consuming when applying your queries.
  • When this option is Off, you will define queries for each element type that exists in the system (that you would like to control the active/inactive status for). No additional processing will be performed. Element status will be based on the results of the queries (elements matching the query will be active, the rest will be inactive).
    Note: If you do not create a query for a particular element type, all elements of that type will be activated.

Refer to Active Topology Queries for more detailed information.

Element Queries List

The list at the top half of the dialog allows you to manage active topology queries for the various element types.

The New and Delete toolbar buttons above the list are provided to allow you to add and delete queries respectively. When you create a new query, you will be prompted to choose an element type (you can only define one query per element type).

Note: If the “Automatically include connected elements option” is on, you will only be allowed to create a Pipe or Customer Meter query (as described above).

Query Statement Field

The query statement field at the bottom half of the dialog allows you to edit the SQL query for the selected element type.

There are 4 toolbar buttons above the query statement field: Query Builder, Copy, Paste, and Validate.

The Query Builder button opens the Query Builder Dialog which provides a list of all available fields and operators to assist you when defining queries.

The Validate button allows you to check if your query is valid and working as expected. An informational message will be displayed to help you correct invalid queries.

Validate on OK

Keep this option on to automatically validate all queries when you click the OK button. Invalid queries will be highlighted giving you the opportunity to correct issues before continuing.